The MPEG-2 standard for encoding and compressing video data uses macroblocks for encoding individual frames from the video data. Each frame is associated with three matrices representing luminance and two chrominance (Cb and Cr) values. The Y matrix has an even number of rows and columns while the Cb and Cr matrices are one-half the size of the Y matrix in each direction (horizontal and vertical) Each matrix is further divided into 8×8 segments known as blocks. Each block from the chrominance matrices is associated with four blocks from the luminance matrix because the luminance matrix is twice the size of the chrominance matrices in both directions. The blocks from the chrominance matrices and the associated four blocks from the luminance matrix together form a macroblock.
Each macroblock is compressed using a variety of algorithms taking advantage of both spatial and temporal redundancies. The macroblocks forming the frames of the video sequence are then packetized and multiplexed for transmission to a decoder that decodes the video sequence.
During the decoding of the video sequence, the frames of the video sequence are decoded and stored in frame buffers. The frame buffers store frames prior to display on a display device. Additionally, frame buffers also store reference frames that are used for decoding frames that are predicted therefrom.
The frames are decoded in units of macroblocks. After decoding a macroblock, the decoder writes the decoded macroblock into a frame buffer. As noted above, the macroblock includes a 16×16 luminance matrix, and two 8×8 chrominance matrices. In order to decode and display frames in real-time, it is advantageous if a simple addressing scheme is used. A particularly simple addressing scheme is based on integer powers of two. Each of the foregoing matrices have an integer power of two bytes (2^8 for the luminance matrix and 2^6 for the chrominance matrix). Accordingly, in a memory storing luminance matrices, the address of the xth luminance matrix is determined by offsetting the starting address with x*2^8. In a memory storing chrominance matrices, the address of the xth chrominance matrix is determined by offsetting the starting address with x*2^6.
Although the luminance and chrominance matrices have an integer power of two bytes, a macroblock comprises 384 bytes. To simplify the addressing scheme for macroblocks, the luminance, and two chrominance matrices are stored in separate, non-contiguous, frame buffer portions.
The foregoing simplifies the addressing scheme for the luminance and two chrominance matrices. However, during the writing of a macroblock, each matrix is written separately because the portions of the frame buffer written to are non-contiguous. As a result, a separate write transaction is required for writing each matrix. The foregoing requires more instructions and operations for writing a macroblocks.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with the present invention as set forth in the remainder of the present application with reference to the drawings.